import { Vue, Component, Prop } from 'vue-property-decorator'

@Component({})
export default class extends Vue {
  @Prop() progressData!: any

  get computedCurrentLevel() {
    return this.progressData.levels[this.progressData.levelIndex];
  }

  get computedProgressColor() {
    return this.computedCurrentLevel?.color
  }

  // 小于最小值则显示5%，这样至少会显示一个进度，对于用户来说视觉上会好看点
  minLevelProcess(levelProcess: number) {
    if (levelProcess <= 0) {
      return 5;
    }

    return levelProcess;
  }

}
